#pragma once
#include "CBrushSpan.h"

class CMILMatrix;
class CGradientStop;
class CGradientStopCollection;

class CGradientBrushSpan :
	public CBrushSpan
{

public: 
	CGradientBrushSpan();
	virtual ~CGradientBrushSpan();
	virtual XINT32 SolidColor(XUINT32 nCPUCore, XINT32 nY, XUINT32 * pPargb);
	virtual XINT32 IsZeroAlpha();
	virtual XINT32 IsOpaque();
protected: 
	HRESULT UpdateTexture(int, enum XcpColorInterpolationMode);
public: 
	virtual HRESULT UpdateTexture(enum XcpColorInterpolationMode nInterpolate);
public: 
	XUINT32 GetTexelCount();
protected: 
	HRESULT InitializeTexture(const CMILMatrix * pmatWorldHPCToDeviceHPC, const struct XPOINTF * pGradientPoints, XBOOL fRadialGradient, const CGradientStop * * ppGradientStops, XUINT32 uCount, enum XcpGradientWrapMode wrapMode, enum XcpColorInterpolationMode colorInterpolationMode, XUINT32 generateGradientTexture, CMILMatrix * pmatDeviceIPCtoGradientTextureHPC);
public: 
	CGradientStopCollection * m_pStops;
protected: 
	XUINT32 m_uTexelCount;
	XUINT32 m_uTexelCountMinusOne;
	struct AGRB64TEXEL * m_rgStartTexelAgrb;
	struct AGRB64TEXEL * m_rgEndTexelAgrb;
	enum XcpGradientWrapMode m_wrapMode;
	XUINT8 m_fZeroAlpha;
	XUINT8 m_fOpaque;



};